<template>
  <div>
    <van-nav-bar :title="activeName"/>
    <router-view></router-view>
    <van-tabbar v-model="active" router>
      <van-tabbar-item icon="home-o" to="/menus" @click="changeTitle('首页')">首页</van-tabbar-item>
      <van-tabbar-item icon="cart-o" to="/card" @click="changeTitle('购物车')">购物车</van-tabbar-item>
      <van-tabbar-item icon="orders-o" to="/order" @click="changeTitle('订单')">订单</van-tabbar-item>
      <van-tabbar-item icon="user-o" to="/message" @click="changeTitle('我的信息')">我的信息</van-tabbar-item>
    </van-tabbar>
  </div>

</template>

<script>
import {doGetUseDic} from "@/api/dic";

export default {
  name: "userIndex",
  data(){
    return{
      active:3,
      menuActive:0,
      activeName:'我的信息'
    }
  },
  methods:{
    changeTitle(title){
      this.activeName=title;
    }
  },
mounted() {
  doGetUseDic(window.localStorage.getItem("sid")).then(res=>{
    if (res.code===200){
      this.$store.state.allMenus=res.data;
    }
  })
}
}
</script>

<style scoped>

</style>
